const express = require('express')
const api = require('../api/neteaseCloudMusicApi');
const {ApiResponse} = require('../model/response');

const router = express.Router();


router.post('/recommend', (req, res) => {
    const {timestamp} = req.query;
    const cookie = `MUSIC_U=003CB2D30DA1865FC9380A7DC10CCD898FDBE5D8BC788A5FFAC2BD7113182AF86F26030CE4A5D65CE971A5248282E450879826397950CF065E20A3441E7AD7A204F5E1D586509A9CE92FC1A1A5E6A14B299AF8E022112712EC81A192E92AC3EFF1115687A9064614E76B6835B1029A2208BAB18E3AC2EAB05C1BA36C0828A506B638AF2FDAD8839A988D252386E985CF000C128B39D48EBFE7BD793795E5702620DEAB817EE53060DF0CC4FBBA625FABCA31CC14A1D075063C285AF2EECD14AEE80A7EFDBBB810DEB6696B4FBD01F661EB73ADEE74B2FAF8D20902105D7197E5796818F9C0DB2688EDDECCEE693C6187C481419DEAB7092882C2520050DC67BD5B5F495646F379A43606201A813FB29305944EC2AA8E162B3575D459D2F611D529BCDCA9D5E93C8C472D1A0DB9CB47C6B3`;
    api.getRecommendVideo(cookie, timestamp)
        .then(result => {
            console.log(result.datas)
            res.json(ApiResponse.ok(200, "成功", result.datas))
        })
        .catch(error => {
            console.log(error);
            res.json(ApiResponse.fail(500, "获取失败"));
        });
})


module.exports = router